package Text22;

import java.util.*;

public class Main {
    static int[] months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    static int y1, m1, d1, y2, m2, d2;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()){
            int date1 = in.nextInt();
            int date2 = in.nextInt();
            y1 = date1 / 10000;
            y2 = date2 / 10000;
            m1 = date1 % 10000 / 100;
            m2 = date2 % 10000 / 100;
            d1 = date1 % 100;
            d2 = date2 % 100;
            System.out.println(Math.abs(calc(y1, m1, d1) - calc(y2, m2, d2)) + 1);
        }
    }

    private static int calc(int y, int m, int d) {
        int ret = 0;
        for (int i = 1; i < y; i++) {
            ret += 365 + is_leap(i);
        }
        for (int i = 1; i < m; i++) {
            ret += get_month_day(y, i);
        }
        return ret + d;
    }

    private static int is_leap(int y) {
        if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {
            return 1;
        }
        return 0;
    }

    private static int get_month_day(int y, int m) {
        if (m == 2) {
            return months[m] + is_leap(y);
        }
        return months[m];
    }
}
